-- GENERATED SPELL FOR [Eclipsion Spellbinder] --


function spell0_22017(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(34447,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22017', 571, 1)
end

function spell1_22017(pUnit, Event) --@Slow,n/a--
pUnit:FullCastSpellOnTarget(18972,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22017', 20313, 1)
end

function spell2_22017(pUnit, Event) --@Summon Arcane Bursts,Self--
pUnit:FullCastSpellOnTarget(38171,pUnit)
pUnit:RegisterEvent('Sorts_22017', 22000, 1)
end

function Sorts_22017(pUnit, Event)
local choix_sorts_22017 = math.random(0, 2)
if choix_sorts_22017 == 0 then
pUnit:RegisterEvent('spell0_22017', 1, 1)
end
if choix_sorts_22017 == 1 then
pUnit:RegisterEvent('spell1_22017', 1, 1)
end
if choix_sorts_22017 == 2 then
pUnit:RegisterEvent('spell2_22017', 1, 1)
end
end

function mob22017_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22017', math.random(1500, 3000), 1)
end

function mob22017_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22017_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22017_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22017, 1, 'mob22017_Action')
RegisterUnitEvent(22017, 2, 'mob22017_Leave')
RegisterUnitEvent(22017, 3, 'mob22017_Kill')
RegisterUnitEvent(22017, 4, 'mob22017_Die')
